package us.pigsoft.client;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;

public class GuiLabel extends GuiElement {

	public GuiLabel(int x, int y, Dimension size, Color outline, String id) {
		super(x, y, size, outline, id);
	}

	@Override
	public void click() {
		
	}

	@Override
	public void entered(boolean in) {
		
	}

	@Override
	public void draw(Graphics2D g) {
		if(size.width == 0 && size.height == 0) {
			g.setColor(outline);
			g.drawString(id, x, y);
		} else {
			// box outline
			g.setColor(outline);
			g.drawRect(x, y, size.width, size.height);
			
			// Draw text
			g.setColor(outline);
			int len = g.getFontMetrics().stringWidth(id);
			int height = g.getFontMetrics().getHeight();
			g.drawString(id, x  + (((size.width) / 2) - len/2), y + ((size.height / 2) + height/3));
		}
	}

	@Override
	public void release() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void pressed(boolean down) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void keyPressed(char key) {
		// TODO Auto-generated method stub
		
	}

}
